11. Wrap an XHR
Wrap an XHR
1.10 Wrap an XHR Quiz
Instructions
First, if you haven't already, read this and follow the instructions on working with the Exoplanet Explorer repo.
- Checkout the
xhr-startbranch and navigate toapp/scripts/app.js. - Wrap the XHR in a Promise in the
get()function. See XHR documentation for more information. - Resolve on load and reject on error.
- If the XHR resolves, use
addSearchHeader()to add the search header to the page. - If the XHR fails,
console.log()the error and pass'unknown'toaddSearchHeader().
Checkout xhr-solution to see my solution.
Solution
1.10 Wrap an XHR Solution